import request from "../axios";

/**
 * 创建刀模订单号
 */
export function createOrder(dieOrder) {
    return request({
        method: "POST",
        url: '/dieOrder/createOrder',
        data: dieOrder
    })
}


/**
 * 创建刀模订单号
 */
export function getOrderList(page, size) {
    return request({
        method: "POST",
        url: '/dieOrder/getOrderList',
        params: {
            page: page,
            size: size
        }
    })
}

/**
 * 用户修改刀模订单
 */
export function updateOrderStatus(customId, type, status) {
    return request({
        method: "POST",
        url: '/dieOrder/updateOrderStatus',
        params: {
            customId: customId,
            type: type,
            status: status
        }
    })
}

/**
 * 登录用户查看自己的刀模订单
 */
export function getOrderListByUser(page, size) {
    return request({
        method: "POST",
        url: '/dieOrder/getOrderListByUser',
        params: {
            page: page,
            size: size
        }
    })
}


/**
 * 查询收益排行榜
 */

export function getIncomeRanking(day) {
    return request({
        method: "POST",
        url: '/dieOrder/getIncomeRanking',
        params: {
            day: day,
        }
    })
}

/**
 * 通过订单查询刀模订单
 */
export function getOrderCommission(customId) {
    return request({
        method: "POST",
        url: '/dieOrder/getOrderCommission',
        params: {
            customId: customId,
        }
    })
}

/**
 * 管理部修改刀模订单
 */

export function updateOrder(dieOrder) {
    return request({
        method: "POST",
        url: '/dieOrder/updateOrder',
        data: dieOrder
    })
}

/**
 * 刀模部搜索模糊查询订单信息
 */
export function getOrderListByLike(date) {
    return request({
        method: "POST",
        url: '/dieOrder/getOrderListByLike',
        params: {
            name: date,
        }
    })
}

/**
 * 通过当前用户查询用户的订单信息,模糊查询
 */
export function getOrderListByLikeAndUser(date) {
    return request({
        method: "POST",
        url: '/dieOrder/getOrderListByLikeAndUser',
        params: {
            name: date,
        }
    })
}


/**
 * 添加客户信息
 */

export function addCustom(date) {
    return request({
        method: "POST",
        url: '/dieCustom/addCustom',
        data: date
    })
}

/**
 * 修改客户信息
 */
export function updateCustom(date) {
    return request({
        method: "POST",
        url: '/dieCustom/updateCustom',
        data: date
    })
}

/**
 * 通过昵称进行模糊查询
 */
export function selectCustomByNickName(name) {
    return request({
        method: "POST",
        url: '/dieCustom/selectCustomByNickName',
        params: {
            name: name
        }
    })
}

/**
 * 通过id删除客户信息
 */
export function deleteCustomById(id) {
    return request({
        method: "POST",
        url: '/dieCustom/deleteCustomById',
        params: {
            id: id
        }
    })
}


/**
 * 查询所有客户信息
 */
export function selectAllCustom() {
    return request({
        method: "POST",
        url: '/dieCustom/selectAllCustom',
    })
}

/**
 * 分页查询客户信息
 */
export function selectCustomByPage(page, size) {
    return request({
        method: "POST",
        url: '/dieCustom/selectCustomByPage',
        params: {
            page: page,
            size: size
        }
    })
}

/**
 * 通过客户名称查询客户账单
 */
export function userNameDieOrderInfo(name, day) {
    return request({
        method: "POST",
        url: '/dieCustom/userNameDieOrderInfo',
        params: {
            name: name,
            day: day
        }
    })
}

/**
 * 查询分红比率
 */
export function getBonus() {
    return request({
        method: "POST",
        url: '/dieBonus/getBonus',
    })
}

/**
 * 修改分红比率
 */
export function updateBonus(params) {
    return request({
        method: "POST",
        url: '/dieBonus/updateBonus',
		data: params
    })
}

/**
 * 获取客户列表
 */
export function getCustomList(params) {
    return request({
        method: "POST",
        url: '/dieCustom/getCustomList',
		data: params
    })
}
